package io.gitee.kotle.demo

import io.gitee.kotle.android.BaseLibraryConfig
import io.gitee.kotle.android.utils.*
import io.gitee.kotle.base.BaseApplication
import io.gitee.kotle.demo.skin_view.skin.BaseSkinPackage
import io.gitee.kotle.demo.skin_view.skin.SkinManage

/**
 *
 * 描述：
 *
 * 创建人：jiale.wei
 * 创建时间：2021/11/23 3:03 下午
 *
 */
class App : BaseApplication() {
    override fun onCreate() {
        super.onCreate()
        BaseLibraryConfig.enableOkHttpTrustAllCertificates = true
//        QMUISwipeBackActivityManager.init(this)
        AppBackgroundRun.addOnBackgroundListener {
            if (it) {
                "App在后台运行".toast()
            }
        }
        SkinManage.updateSkin(BaseSkinPackage())
        SqliteConfig("Kotle", 1, listOf()).toCurrentSqlite()
        BaseLibraryConfig.glideOkHttpClient = {
            it.build()
        }
        BaseLibraryConfig.coilOkHttpClient = {
            it.build()
        }

        /**
         * 监听网络状态
         */
        startNetWorkObServe(object : NetworkStatusUtil.StatusListener {
            override fun onNetWorkChange(status: Int) {

            }
        })
    }
}